<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$doc = JFactory::getDocument();
$doc->addStyleSheet(JURI::root().'/components/com_mojo/wp-content/themes/default/style.css');

?>
<?php if (have_posts()) : ?>
		
<?php while (have_posts()) : the_post(); ?>
				
			<div id="mojo-post-<?php the_ID(); ?>" class="post" >
				<h3>
					<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
					<span class="userEdit"><?php edit_post_link('Edit this entry.','',''); ?></span>
				</h3>
				<div class="post-date"><?php the_time('F jS, Y') ?></div>
				<div class="post-author"> by <?php the_author() ?> </div>
				<div class="post-entry"><?php the_content('<span>Read the rest of this entry &raquo;</span>'); ?></div><!--/post-entry-->
			<?php if (is_single()) { ?>
			
			<div class="postmeta">
					<span>filed under <?php the_category(', ') ?> on <?php the_time('l, F jS, Y') ?>.<br />
												
						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Both Comments and Pings are open ?>
							You can <a href="<?php echo sefRelToAbs( 'index.php?option=com_mojo&Itemid='.$Itemid.'&p='.$post->ID ) ?>#respond">comment</a>, or 
							<a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a>. <br />
						
						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Only Pings are Open ?>
							Comments are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.
						
						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Comments are open, Pings are not ?>
							You can skip to the end and leave a comment. Pinging is currently not allowed.
			
						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Neither Comments, nor Pings are open ?>
							Both comments and pings are currently closed.			
						
						<?php }  ?>
						</span>
			</div><!--/postmeta-->
			
			<?php // bottom per post position for joomla modules
				 if(mosCountModules("bmojopost")){?>
				<div class="bmojopost">
					<div class="bmojoInner">
						<?php mosLoadModules ( 'bmojopost' ); ?>
					</div>
				</div><!--[end] mojoblog bottom module-->
			<?php } ?>
				
			</div><!--/mojo-post-->
			
			<?php comments_template(); ?>
			
			<?php } else { ?>
			<div class="postmeta">Posted in <?php the_category(', ') ?> | <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></div>
				
			</div><!--/mojo-post-->
	
			<?php } ?>
			
		<?php endwhile; ?>

		<div class="navigation">
			<span class="alignleft"><?php next_posts_link('&laquo; older posts') ?></span>
			<span class="alignright"><?php previous_posts_link('newer posts &raquo;') ?></span>
		</div>
		
<!--/POSTS-->
		
	<?php else : ?>

<!--START 404-->
		<div id="error">
		<h2>Not Found</h2>
		<p class="sorry">URP!! Sorry, but you are looking for something that isn't here.</p>
		</div>
<!--/404-->
	<?php endif; ?>

	</div>
<!--/mojo-main-->
<?php get_footer();?>